home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / 13h_kit / idemo.dsk (.txt) < prev    next >
Turbo C Context File  |  1991-07-05  |  32KB  |  659 lines

  1. Turbo C Context File 
  2.     w    H    
  3. KEYBOARD.CPP
  4. IMAGES.CPP
  5. IDEMO.CPP
  6. KEYBOARD.CPP
  7. IMAGES.CPP
  8. IDEMO.CPP
  9. KEYBOARD.CPP
  10. IMAGES.CPP
  11. IDEMO.CPP
  12. KEYBOARD.CPP
  13. IMAGES.CPP
  14. IDEMO.CPP
  15. KEYBOARD.CPP
  16. IMAGES.CPP
  17. IDEMO.CPP
  18. KEYBOARD.CPP
  19. IMAGES.CPP
  20. IDEMO.CPP
  21. KEYBOARD.CPP
  22. IMAGES.CPP
  23. IDEMO.CPP
  24. KEYBOARD.CPP
  25. IMAGES.CPP
  26. IDEMO.CPP
  27. KEYBOARD.CPP
  28. IMAGES.CPP
  29. IDEMO.CPP
  30. KEYBOARD.CPP
  31. IMAGES.CPP
  32. IDEMO.CPP
  33. KEYBOARD.CPP
  34. IMAGES.CPP
  35. IDEMO.CPP
  36. KEYBOARD.CPP
  37. IMAGES.CPP
  38. IDEMO.CPP
  39. KEYBOARD.CPP
  40. IMAGES.CPP
  41. IDEMO.CPP
  42. KEYBOARD.CPP
  43. IMAGES.CPP
  44. IDEMO.CPP
  45. KEYBOARD.CPP
  46. IMAGES.CPP
  47. IDEMO.CPP
  48. KEYBOARD.CPP
  49. IMAGES.CPP
  50. IDEMO.CPP
  51. KEYBOARD.CPP
  52. IMAGES.CPP
  53. IDEMO.CPP
  54. KEYBOARD.CPP
  55. IMAGES.CPP
  56. IDEMO.CPP
  57. KEYBOARD.CPP
  58. IMAGES.CPP
  59. IDEMO.CPP
  60. KEYBOARD.CPP
  61. IMAGES.CPP
  62. IDEMO.CPP
  63. KEYBOARD.CPP
  64. IMAGES.CPP
  65. IDEMO.CPP
  66. KEYBOARD.CPP
  67. IMAGES.CPP
  68. IDEMO.CPP
  69. KEYBOARD.CPP
  70. IMAGES.CPP
  71. IDEMO.CPP
  72. KEYBOARD.CPP
  73. IMAGES.CPP
  74. IDEMO.CPP
  75. KEYBOARD.CPP
  76. IMAGES.CPP
  77. IDEMO.CPP
  78. KEYBOARD.CPP
  79. IMAGES.CPP
  80. IDEMO.CPP
  81. KEYBOARD.CPP
  82. IMAGES.CPP
  83. IDEMO.CPP
  84. KEYBOARD.CPP
  85. IMAGES.CPP
  86. IDEMO.CPP
  87. KEYBOARD.CPP
  88. IMAGES.CPP
  89. IDEMO.CPP
  90. KEYBOARD.CPP
  91. IMAGES.CPP
  92. IDEMO.CPP
  93. KEYBOARD.CPP
  94. IMAGES.CPP
  95. IDEMO.CPP
  96. KEYBOARD.CPP
  97. IMAGES.CPP
  98. IDEMO.CPP
  99. KEYBOARD.CPP
  100. IMAGES.CPP
  101. IDEMO.CPP
  102. KEYBOARD.CPP
  103. IMAGES.CPP
  104. IDEMO.CPP
  105. KEYBOARD.CPP
  106. IMAGES.CPP
  107. IDEMO.CPP
  108. KEYBOARD.CPP
  109. IMAGES.CPP
  110. IDEMO.CPP
  111. KEYBOARD.CPP
  112. IMAGES.CPP
  113. IDEMO.CPP
  114. KEYBOARD.CPP
  115. IMAGES.CPP
  116. IDEMO.CPP
  117. KEYBOARD.CPP
  118. IMAGES.CPP
  119. IDEMO.CPP
  120. KEYBOARD.CPP
  121. IMAGES.CPP
  122. IDEMO.CPP
  123. KEYBOARD.CPP
  124. IMAGES.CPP
  125. IDEMO.CPP
  126. KEYBOARD.CPP
  127. IMAGES.CPP
  128. IDEMO.CPP
  129. KEYBOARD.CPP
  130. IMAGES.CPP
  131. IDEMO.CPP
  132. KEYBOARD.CPP
  133. IMAGES.CPP
  134. IDEMO.CPP
  135. KEYBOARD.CPP
  136. IMAGES.CPP
  137. IDEMO.CPP
  138. KEYBOARD.CPP
  139. IMAGES.CPP
  140. IDEMO.CPP
  141. KEYBOARD.CPP
  142. IMAGES.CPP
  143. IDEMO.CPP
  144. KEYBOARD.CPP
  145. IMAGES.CPP
  146. IDEMO.CPP
  147. KEYBOARD.CPP
  148. IMAGES.CPP
  149. IDEMO.CPP
  150. KEYBOARD.CPP
  151. IMAGES.CPP
  152. IDEMO.CPP
  153. KEYBOARD.CPP
  154. IMAGES.CPP
  155. IDEMO.CPP
  156. KEYBOARD.CPP
  157. IMAGES.CPP
  158. IDEMO.CPP
  159. KEYBOARD.CPP
  160. IMAGES.CPP
  161. IDEMO.CPP
  162. KEYBOARD.CPP
  163. IMAGES.CPP
  164. IDEMO.CPP
  165. KEYBOARD.CPP
  166. IMAGES.CPP
  167. IDEMO.CPP
  168. D:\WORKSHOP\SOURCE\*.C
  169. D:\WORKSHOP\SOURCE\*.*]
  170. D:\WORKSHOP\SOURCE\*.*
  171. *.CPP
  172. input_status_1
  173. vbi_mask
  174. static
  175. current_font
  176. *.CPP
  177. cycle
  178. palette[i][j]/cycle
  179. fade_adj[i-1][j-1]
  180. palette
  181. palette[i][j]
  182. current
  183. current[i][j]
  184. fade_adj
  185. fade_adj[i][j]
  186. gradient
  187. readsize
  188. mapsize
  189. D:\WORKSHOP\SOURCE\NONAME00.CPP
  190. D:\COMM\TAPCIS\WORKING\DDJFORUM.SAV
  191. D:\WORKSHOP\SOURCE\PTRDEMO.CPP
  192. D:\MARK4\TEST.CPP
  193. D:\MARK4\DESIGN.TXT
  194. D:\MARK4\EGA.ASM
  195. D:\WORKSHOP\SOURCE\BALLTEST.CPP
  196. D:\WORKSHOP\13KIT\IDEMO.CPP
  197. D:\WORKSHOP\13KIT\KEYBOARD.HPP
  198. D:\WORKSHOP\13KIT\KEYBOARD.HPP
  199. D:\WORKSHOP\13KIT\IDEMO.CPP
  200. D:\WORKSHOP\13KIT\IMAGES.HPP
  201. D:\WORKSHOP\13KIT\KEYBOARD.CPP
  202. D:\WORKSHOP\13KIT\IMAGES.CPP
  203. )YFILE    *Pcx;          // file pointer
  204. PcxHdr  *Header;       // header structure
  205. FILE    *Pcx;          // file pointer
  206. ColorReg Palette[255]; // palette structure
  207. #include <conio.h>
  208. main(){int k,i,s=0,j,d;char c;do{clrscr();gotoxy(38,6);printf("+ +");
  209. for(i=1;i<=80;i++){for(d=1;d<1000;d++);gotoxy(1,1);printf("SCORE = %d ",s);
  210. gotoxy(i-1,14);printf(" ");gotoxy(i,14);printf("&");if(kbhit()){c=getch();
  211. if(c==32){for(j=13;j>=6;j--){gotoxy(i,j+1);printf(" ");gotoxy(i,j);
  212. printf(".");if(j==7)((i==38)||(i==40))?s--:i==39?s++:s;}}}}}while(c!=27);}
  213.     bar((xdim*5),(ydim*5),((xdim*5)+5),((ydim*5)+5));
  214.     maze[xdim][ydim] = 1;
  215. extern void _loadpalette(int start, int number, PRec* palette);
  216. extern void _readpalette(int start, int number, PRec* palette);
  217.     unsigned int i;
  218.     if ((start>255) | (start<0) | ((start+number)>255))
  219.         return(0);
  220.     for (i=start,i=(start+number),i++) {
  221.         asm cli;
  222.         portb(0x3C8) = i;
  223.         portb(0x3C9) = palette->RGB[i].Red;
  224.         portb(0x3C9) = palette->RGB[i].Green;
  225.         portb(0x3C9) = palette->RGB[i].Blue;
  226.         asm sti;
  227. portb(0x3C9) =
  228. portb(0x3C9) = 
  229. portb(0x3C9) = 
  230. void clrscr(int color)
  231. void barfill(int tlx, int tly, int brx, int bry, int color)
  232. void _setgraphseg(unsigned int newseg)
  233. ,PRec *Palette
  234. ,PRec *Palette
  235. void  UnpackPcx(char far *Source, char far *Dest, unsigned int NumBytes)
  236. FILE *InitPcxFile(char *Fspec,PRec *Palette,struct PcxHdr *Header)
  237. extern "C" 
  238. mlevel::mlevel() {
  239.     int i,j;
  240.     for(i=0;i<64;i++) {
  241.        for(j=0;j<40;j++) {
  242.            maze[i][j].type = 0;
  243.        }
  244. MicrosoftMouse MM;    // Only instance allowed!
  245. MicrosoftMouse MM;    // Only instance allowed!
  246. //**************************************************************************
  247. // IMAGES.CPP -source file for basic video operations in mode 0x13.          *
  248. // Copyright 1991 by the Gamers Programming Workshop, a function of the    *
  249. // GAMERS forum, Compuserve. For more info e-mail 76605,2346.              *
  250. //                                                                         *
  251. // License is granted for use or modification of this code as long as      *
  252. // this notice remains intact, and all improvements are listed in the      *
  253. // version history below, and uploaded to the GAMERS forum. This code      *
  254. // may not be used for any commercial purpose.                             *
  255. //                                                                         *
  256. // PCX stuff adapted from "BitMapped Graphics"  by Steve Rimmer (1990      *
  257. // Windcrest)                                                              *
  258. //**************************************************************************
  259. //**************************************************************************
  260. // Version history:                                                        *
  261. //                                                                         *
  262. // Version 1.0                                                             *
  263. // Developed: May 2, 1991                                                  *
  264. // Author:    Mark Betz, 76605, 2346                                       *
  265. // Last update: May 30, 1991                                               *
  266. //**************************************************************************
  267. // KEYBOARD.CPP ************************************************************
  268. // module for low level filtered and unfiltered keyboard i/o.              *
  269. // Copyright 1991 by the Gamers Programming Workshop, a function of the    *
  270. // GAMERS forum, Compuserve. For more info e-mail 76605,2346.              *
  271. //                                                                         *
  272. // License is granted for use or modification of this code as long as      *
  273. // this notice remains intact, and all improvements are listed in the      *
  274. // version history below, and uploaded to the GAMERS forum. This code      *
  275. // may not be used for any commercial purpose.                             *
  276. //                                                                         *
  277. // PCX stuff adapted from "BitMapped Graphics"  by Steve Rimmer (1990      *
  278. // Windcrest)                                                              *
  279. //**************************************************************************
  280. //**************************************************************************
  281. // Version history:                                                        *
  282. //                                                                         *
  283. // Version 1.0                                                             *
  284. // Developed: May 30, 1991                                                 *
  285. // Author:    Mark Betz, 76605, 2346                                       *
  286. // Last update: May 30, 1991                                               *
  287. //**************************************************************************
  288. void stuffbuffer(key_event *event);
  289.     for(j=0;j<f_hdr.fram_hit;j++) {
  290.         for (i=0;i<f_hdr.fram_wid;i++) {
  291.             src=p[(j*f_hdr.fram_wid)+i];
  292.             if (src==f_hdr.f_color) {
  293.                 dst=fore_color;
  294.                 writepixel(x+i,y+j,dst);
  295.             } else
  296.                 if (see_thru==opaque) {
  297.                     dst=back_color;
  298.                     writepixel(x+i,y+j,dst);
  299.                 }
  300.     int i,j;
  301.     for(j=0;j<f_hdr.fram_hit;j++) {
  302.         for (i=0;i<f_hdr.fram_wid;i++) {
  303.             writepixel(x+i,y+j,forecolor);
  304.     for(j=0;j<f_hdr.fram_hit;j++) {
  305.         for (i=0;i<(f_hdr.fram_wid-2);i++) {
  306.             writepixel(x+i,y+j,back_color);
  307.             asm {
  308.                 xor ah, ah
  309.                 int 0x1A
  310.                 mov tick, dx
  311.             while ((_DX<(tick+3))&&(!kbhit())) {
  312.             asm {
  313.                 xor ah, ah
  314.                 int 0x1A
  315.                 }
  316.     unsigned int *clock=(unsigned int *)MK_FP(0x0040,0x006C);
  317. void Octant0(unsigned int x0,unsigned int y0,unsigned int deltaX,
  318.              unsigned int deltaY, int Xdirection, int color) {
  319.     small.setstyle(0,15,1,trans,3);
  320.     small.readstr(30,30,str,30);
  321.     window(int tlx, int tly, int xwid, int ywid, void *bmap,
  322.            char brdrwid, char shdwwid, char bgrnd, char border);
  323. extern void getimage(int x0, int y0, int x1, int y1, void *buff);
  324. extern void putimage(int x0, int y0, int x1, int y1, void *buff);
  325.     int origX;
  326.     int origY;
  327.     int xsize;
  328.     int ysize;
  329.     char bdrwid;
  330.     char shdwid;
  331.     char b_grnd;
  332.     char brdr;
  333. xy_to_ptr(x0,i),
  334. MK_FP(FP_OFF(buff),FP_SEG(buff)+(i*(x1-x0))),
  335. const char SnapFade = 0;         // simple block copy to vram
  336. const char SplitVFade = 1;       // fades from top and bottom
  337. const char SplitHFade = 2;       // fades from right and left
  338. const char MultiVFade = 3;       // fades multiple vertical slices
  339. const char MultiHFade = 4;       // fades multiple horizontal slices
  340. const char SparkleFade = 5;      // fades with random pixel placement
  341. const char SoftFade = 6;         // does a palette shifted fade
  342.             outportb(DacWrite,i);
  343.             outportb(DacData,testred);
  344.             outportb(DacData,testgrn);
  345.             outportb(DacData,testblu);
  346.     PRec palette;
  347.             current[i][0]+=change[i][0];
  348.             outportb(DacData,current[i][0]);
  349. const char SnapFade=0;         // simple block copy to vram
  350. const char SplitVFade=1;       // fades from top and bottom
  351. const char SplitHFade=2;       // fades from right and left
  352. const char MultiVFade=3;       // fades multiple vertical slices
  353. const char MultiHFade=4;       // fades multiple horizontal slices
  354. const char SparkleFade=5;      // fades with random pixel placement
  355. const char SoftFade=6;           // does a palette shifted fade
  356. // For use with type PRec (declared in images.hpp **************************
  357. const short Red = 0;               // constants used with type PRec
  358. const short Green = 1;             // example: PRec Palette;
  359. const short Blue = 2;               //          Palette[0][Green]=63;
  360. // *************************************************************************
  361.     pcx(char *fspec, int offset, int bsize)
  362.     for (j=0;str[j]!=0;j++);   // one line gets length of string
  363.     if ((picture==NULL)||(picture->getstatus()!=Success)) {
  364.         printf("error creating navaho.pcx object");
  365.         return(1);
  366.     picture = new pcx("newtut.pcx");
  367.     if ((picture==NULL)||(picture->getstatus()!=Success)) {
  368.         printf("error creating newtut.pcx object");
  369.         return(1);
  370.     waitkey();
  371.     picture->remove(SoftFade);
  372.     picture->display(SoftFade);
  373.     delete(picture);
  374. The constant 64000 and the expression (for instance) 6400*10 are not the
  375. same value.  The former, being positive and > 32767, is interpreted by the
  376. compiler as a long (and is positive).  The latter is computed to 16 bits
  377. only, with the result representing a 16-bit negative value.  When you do
  378. (unsigned)64000 I'm not sure offhand what you get.
  379. Compile this program in small model and note the result; then remove all
  380. occurrences of the keyword huge and compile in large model and note the
  381. (different) result.
  382.  #include <stdio.h>
  383.  #include <stdlib.h>
  384.  #include <dos.h>
  385. int main(void)
  386.    char huge *ptr;
  387.    ptr = (char huge *) MK_FP(0xa000, 0x0000);
  388.    printf("ptr = %Fp\n", ptr);
  389.    ptr = ptr + 64000;          /* warning generated here */
  390.    printf("ptr = %Fp\n", ptr);
  391.    ptr = (char huge *) MK_FP(0xa000, 0x0000);
  392.    printf("ptr = %Fp\n", ptr);
  393.    ptr = ptr + 6400*10;
  394.    printf("ptr = %Fp\n", ptr);
  395.    return 0;
  396.  Gary
  397. {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  398.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  399.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  400.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  401.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  402. {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  403.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  404.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  405.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  406.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  407.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  408.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  409.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  410.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  411.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  412.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  413.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  414.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  415.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  416.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  417.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  418.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  419.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  420.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  421.                             {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}},
  422.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  423.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  424.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  425.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  426.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  427.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
  428.                          { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  429.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  430.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  431.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  432.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  433.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  434.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
  435.                          { {0, 0, 0,10,10,10,10, 0, 0, 0},
  436.                            {0, 0,13,10,10,10,10,11, 0, 0},
  437.                            {0, 0,13,10,10,10,10,11, 0, 0},
  438.                            {0, 0,13,13, 0, 0,11,11, 0, 0},
  439.                            {0, 0,13,12,12,12,12,11, 0, 0},
  440.                            {0, 0,13,12,12,12,12,11, 0, 0},
  441.                            {0, 0, 0,12,12,12,12, 0, 0, 0} },
  442.                          { {0, 0, 0, 0,10,10, 0, 0, 0, 0},
  443.                            {0, 0, 0,10,10,10,10, 0, 0, 0},
  444.                            {0, 0,13,10,10,10,10,11, 0, 0},
  445.                            {0, 0,13,13, 0, 0,11,11, 0, 0},
  446.                            {0, 0,13,12,12,12,12,11, 0, 0},
  447.                            {0, 0, 0,12,12,12,12, 0, 0, 0},
  448.                            {0, 0, 0, 0,12,12, 0, 0, 0, 0} },
  449.                          { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  450.                            {0, 0, 0, 0,10,10, 0, 0, 0, 0},
  451.                            {0, 0, 0,10,10,10,10, 0, 0, 0},
  452.                            {0, 0,13,13, 0, 0,11,11, 0, 0},
  453.                            {0, 0, 0,12,12,12,12, 0, 0, 0},
  454.                            {0, 0, 0, 0,12,12, 0, 0, 0, 0},
  455.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
  456.                          { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  457.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  458.                            {0, 0, 0, 0,10,10, 0, 0, 0, 0},
  459.                            {0, 0, 0,13, 0, 0,11, 0, 0, 0},
  460.                            {0, 0, 0, 0,12,12, 0, 0, 0, 0},
  461.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  462.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
  463. { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  464.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  465.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  466.                            {0, 0, 0, 0,10,10, 0, 0, 0, 0},
  467.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  468.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  469.                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
  470. extern void unpackpcx(FILE *pcx, const char far *source,
  471.                       char far *dest, unsigned int num_bytes);
  472. // **** System level graphics functions ***********************************
  473. extern void setgraphmode();
  474. extern void settextmode();
  475. extern void wait_vbi();
  476. extern void reporterr(char type, char where[30]);
  477. // **** DAC palette functions *********************************************
  478. extern void loadpalette(int start, int number, const p_rec palette);
  479. extern void readpalette(int start, int number, p_rec palette);
  480. extern void clrpalette(int start, int number);
  481. extern void fadepalettein(int start, int count, const p_rec palette);
  482. extern void fadepaletteout(int start, int count);
  483. // **** Graphics segment redirection **************************************
  484. extern void setgraphseg(unsigned newseg);
  485. // **** Drawing primitives ************************************************
  486. extern void clearscr(int color);
  487. extern void barfill(int tlx, int tly, int brx, int bry, int color);
  488. extern void writepixel(int x, int y, int color);
  489. extern char readpixel(int x, int y);
  490. extern void far *xy_to_ptr(int x, int y);
  491. extern void line(int x0, int y0, int x1, int y1, int color);
  492. // **** Image block copying functions *************************************
  493. extern void getimage(int x0, int y0, int x1, int y1, char far *buff);
  494. extern void putimage(int x0, int y0, int x1, int y1, char far *buff);
  495. extern void copyimage(int x0, int y0, int x1, int y1, int putx, int puty,
  496.                       void far *src_buf);
  497. // **** Image fades and dissolve functions ********************************
  498. extern void doSplitVerticalWipe(void far *pic_buf);
  499. extern void doSplitHorizWipe(void far *pic_buf);
  500. extern void doSlideVerticalWipe(void far *pic_buf);
  501. extern void doSlideHorizWipe(void far *pic_buf);
  502. extern void doVerticalDissolve(void far *pic_buf);
  503. extern void doHorizDissolve(void far *pic_buf);
  504. extern void doSparkleDissolve(void far *pic_buf);
  505. // image fade constants ***************************************************
  506. const char SnapWipe = 0;             // simple block copy to vram
  507. const char SplitVerticalWipe = 1;    // fades from top and bottom
  508. const char SplitHorizWipe = 2;       // fades from right and left
  509. const char SlideVerticalWipe = 3;    // slides image in from right and left
  510. const char SlideHorizWipe = 4;       // slides image in from top and bottom
  511. const char VerticalDissolve = 5;     // fades multiple vertical slices
  512. const char HorizDissolve = 6;        // fades multiple horizontal slices
  513. const char SparkleDissolve = 7;      // fades with random pixel placement
  514. const char SoftFade=8;                 // does a palette shifted fade
  515. // error reporting constants **********************************************
  516. const char NoErr = 0;            // no error occured
  517. const char MemErr = 1;           // error occured allocating memory
  518. const char FileReadErr = 2;      // error occured reading a file
  519. const char FileWriteErr = 3;     // error occured writing a file
  520. const char FileMakeErr = 4;      // error occured creating a file
  521. const char FileOpenErr = 5;      // error occured opening file
  522. const char FileFormatErr = 6;    // bad file format error
  523. const char SecondaryErr = 7;     // error occured in subroutine during call
  524. const char UnknownErr = 8;       // an unknown error occured
  525. // For use with type PRec *************************************************
  526. const short Red = 0;               // constants used with type PRec
  527. const short Green = 1;             // example: PRec Palette;
  528. const short Blue = 2;               //          Palette[0][Green]=63;
  529. // for use with call to pcx::load() ***************************************
  530. const char Packed = 0;             // load image in compressed form
  531. const char Unpacked = 1;           // load image in uncompressed form
  532. const char Bestfit = 2;            // load compressed or uncompressed
  533. static unsigned int GRAPH_SEG = 0xA000; // segment for video operations
  534. static p_rec current;                   // palette record for fades
  535. extern void getkey(char *key, extnd *scan);
  536. extern boolean getfilteredkey(char mask, char *key, extnd *scan);
  537. extern void stuffbuffer(char key, extnd scan);
  538. extern void flushBuffer(char *buf);
  539. enum boolean {false,true};
  540. // keyboard constants for special keys *************************************
  541. // prefixes: C_  : Ctrl and key
  542. //           S_  : Shift and key
  543. //           A_  : Alt and key      example: A_F2 = alt-f2
  544. // *************************************************************************
  545. enum extnd {F1=59,F2,F3,F4,F5,F6,F7,F8,F9,F10,
  546.             F11=133,F12,
  547.             S_F1=84,S_F2,S_F3,S_F4,S_F5,S_F6,S_F7,S_F8,S_F9,S_F10,
  548.             S_F11=135,S_F12,
  549.             C_F1=94,C_F2,C_F3,C_F4,C_F5,C_F6,C_F7,C_F8,C_F9,C_F10,
  550.             C_F11=137,C_F12,
  551.             A_F1=104,A_F2,A_F3,A_F4,A_F5,A_F6,A_F7,A_F8,A_F9,A_F10,
  552.             A_F11=139,A_F12,
  553.             S_TAB=15,
  554.             HOME=71,UP_ARR,PG_UP,LT_ARR=75,RT_ARR=77,END=79,DN_ARR,
  555.             PG_DN,INS,DEL,
  556.             C_PRTSC=114,C_LT_ARR,C_RT_ARR,C_END,C_PG_DN,C_HOME,
  557.             C_PG_UP=132, NO_EXT=0};
  558. // *************************************************************************
  559. // mask types passed to getfilteredkey() to select keymask. Masks operate
  560. // as follows:  U_CASE   - returns only upper case characters
  561. //                L_CASE   - returns only lower case characters
  562. //                B_CASE   - returns characters of both cases
  563. //                NUMBER   - returns only numbers
  564. //                FUNCT    - returns only function keys
  565. //                CURSOR   - returns only cursor positioning keys
  566. //              PUNCT    - returns only punctuation marks
  567. //              ESC      - returns only the escape key
  568. // the masks can be combined with a logical OR in the call, for example:
  569. // if(getfilteredkey(&this_event,U_CASE|NUMBER|FUNCT))
  570. // will return true if the key pressed was an upper case character, a
  571. // number, or a function key. If true, the key's ascii code and scan
  572. // value are in struct key_event this_event.
  573. // *************************************************************************
  574. const char UCASE = 0x1;
  575. const char LCASE = 0x2;
  576. const char BCASE = 0x4;
  577. const char NUMBER = 0x8;
  578. const char FUNCT  = 0x10;
  579. const char CURSOR = 0x20;
  580. const char PUNCT  = 0x40;
  581. const char ESC   = 0x80;
  582. >>>KEYBOARD.DOC
  583. A. Copyright Information
  584. Keyboard.Hpp and Keyboard.Cpp along with this document file are copyright
  585. 1991 by the Gamers Programming Workshop, GAMERS forum, Compuserve (GO GAMERS,
  586. section 11). The code and related document are free for use, distribution,
  587. and modification, provided the following conditions are met:
  588.     1. no commercial use of this source code or documents is permitted.
  589.     2. no fee may be charged beyond disk duplication cost for any of this
  590.        material.
  591.     3. If the code is upgraded or modified a copy of the modification must
  592.        be uploaded to section 11 of the GAMERS forum on Compuserve. All
  593.        modifications must be documented and the author's name included in
  594.        the source code header block, and the subsequent file package must
  595.        include all the original doc files as well as any additions. If you
  596.        modify or add functions please update the function list below.
  597. B. Description
  598. class win {
  599.     public:
  600.     char status;             // 1 if window opened successfully
  601.     win(int tlx, int tly, int xwid, int ywid, char *bmap,
  602.            char brdrwid, char shdwwid, char bgrnd, char border);
  603.     char installed(){return(status);}   // returns the status value
  604.     ~win();
  605.     private:
  606.     char far *backgrnd;      // pointer to background bitmap
  607.     int origX;               // top left x coord of the window
  608.     int origY;               // top left y coord of the window
  609.     int xsize;               // window x dimension in pixels
  610.     int ysize;               // window y dimension in pixels
  611.     char bdrwid;             // border width, 0 if no border
  612.     char shdwid;             // shadow width, 0 if no shadow
  613.     char shdwon;             // 1 if shadow is on, 0 if not
  614.     char b_grnd;             // window background color
  615.     char brdr;               // border color, ignored if bdrwid=0;
  616. >>>WIN.DOC
  617. A. Copyright Information
  618. Images.Hpp and Images.Cpp along with this document file are copyright
  619. 1991 by the Gamers Programming Workshop, GAMERS forum, Compuserve (GO GAMERS,
  620. section 11). The code and related document are free for use, distribution,
  621. and modification, provided the following conditions are met:
  622.     1. no commercial use of this source code or documents is permitted.
  623.     2. no fee may be charged beyond disk duplication cost for any of this
  624.        material.
  625.     3. If the code is upgraded or modified a copy of the modification must
  626.        be uploaded to section 11 of the GAMERS forum on Compuserve. All
  627.        modifications must be documented and the author's name included in
  628.        the source code header block, and the subsequent file package must
  629.        include all the original doc files as well as any additions. If you
  630.        modify or add functions please update the function list below.
  631. B. Description
  632. class image {
  633.     public:
  634.     p_rec palette;                        // holds the default image palette
  635.     char fpath[80];                       // stores the disk path to image
  636.     char getstatus() {return(status);}    // returns status of last op
  637.                                           // 1 if successful, 0 if not
  638.     protected:
  639.     char in_ram;                          // 1 if image in ram, 0 if not
  640.     char packed;                          // 1 if packed in ram, 0 if not
  641.     char status;                          // returned by getstatus()
  642.     char far *buffer;                     // pointer for ram buffer if any
  643. class pcx : public image {
  644.     public:
  645.     pcx(char *fspec);                     // constructor
  646.     char load(char method);               // load into ram packed or unpacked
  647.     void unload();                        // unload from ram
  648.     char display(char fadetype);          // display image using fadetype
  649.     void remove(char fadetype);           // remove image using fadetype
  650.     ~pcx();                                  // destructor
  651.     private:
  652.     char unpacktoram(char far *dest,      // internal, unpack to memory
  653.                      unsigned numbytes);
  654.     if((handle=open(fntfile,O_CREAT|O_BINARY,S_IREAD|S_IWRITE))==-1) {
  655.         _settextmode();
  656.         printf("error creating font file\n");
  657.         _settextmode();
  658.         return;
  659.